function del(gid)
{
	$("#result").hide();
	$.ajax({
		   type: "POST",
		   //这里的URL可以拼接
		   url: '/ybkbuy/tbener/admin.php/changedata/delgoods',
		   data: {id:gid},
		   success: 
		   function(msg){
			 var obj = eval( "(" + msg + ")" );
			 $("#result").html(obj.data);
			 $("#result").slideDown("slow",function(){
				   //alert(obj.info);
					 if(obj.info == 1)
					 {
							//remove the goods
							//alert('ok');
							$("#"+gid).remove();
							
					 }
			 });
		   }
		});
}

function delall(gid)
{
	$("#result").hide();
	$.ajax({
		   type: "POST",
		   //这里的URL可以拼接
		   url: '/ybkbuy/tbener/admin.php/changedata/delallgoods',
		   data: {id:gid},
		   success: 
		   function(msg){
			 var obj = eval( "(" + msg + ")" );
			 $("#result").html(obj.data);
			 $("#result").slideDown("slow",function(){
				   //alert(obj.info);
					 if(obj.info == 1)
					 {
							//remove the goods
							//alert('ok');
							//$("#"+gid).remove();
							//jump(10);
							setTimeout("jump('/ybkbuy/tbener/admin.php/changedata/index')",5000);    //5秒后弹出对话框
							
					 }
			 });
		   }
		});
}
function jump(url) {   
        window.location.href=url;
}   
function saveshop()
{
	$("#result").hide();
	$.ajax({
		   type: "POST",
		   //这里的URL可以拼接
		   url: '/ybkbuy/tbener/admin.php/person/shopinfosave',
		   data: $("#form1").serialize(),
		   success: 
		   function(msg){
			 var obj = eval( "(" + msg + ")" );
			 $("#result").html(obj.data);
			 $("#result").slideDown("slow",function(){
				   //alert(obj.info);
					// if(obj.info == 1)
					 //{
							//remove the goods
							//alert('ok');
							//$("#"+gid).remove();
							
					// }
			 });
		   }
		});
}
function uinfo()
{
	$("#result").hide();
	$.ajax({
		   type: "POST",
		   //这里的URL可以拼接
		   url: '/ybkbuy/tbener/admin.php/person/saveinfo',
		   data: $("#form1").serialize(),
		   success: 
		   function(msg){
			 var obj = eval( "(" + msg + ")" );
			 $("#result").html(obj.data);
			 $("#result").slideDown("slow",function(){
				   //alert(obj.info);
					// if(obj.info == 1)
					 //{
							//remove the goods
							//alert('ok');
							//$("#"+gid).remove();
							
					// }
			 });
		   }
		});
}

function uinfoadd()
{
	$("#result").hide();
	$.ajax({
		   type: "POST",
		   //这里的URL可以拼接
		   url: '/ybkbuy/tbener/admin.php/admin/addpersonsave',
		   data: $("#form1").serialize(),
		   success: 
		   function(msg){
			 var obj = eval( "(" + msg + ")" );
			 $("#result").html(obj.data);
			 $("#result").slideDown("slow",function(){
				   //alert(obj.info);
					// if(obj.info == 1)
					 //{
							//remove the goods
							//alert('ok');
							//$("#"+gid).remove();
							
					// }
			 });
		   }
		});
}

function copyuimg(uid)
{
		//alert(uid);
		$("#result").hide();
		$.ajax({
				 type: "POST",
				 //这里的URL可以拼接
				 url: '/ybkbuy/tbener/admin.php/admin/copyimg/gid/'+uid,
				 data: $("#form1").serialize(),
				 success: 
				 function(msg){
				 var obj = eval( "(" + msg + ")" );
				 $("#result").html(obj.data);
					//alert('aakkkkkk');
					$("#result").slideDown("slow");
				 }
			});
}

function savegoods()
{
	//alert('aa');
	$("#result").hide();
	$.ajax({
		   type: "POST",
		   //这里的URL可以拼接
		   url: '/ybkbuy/tbener/admin.php/changedata/saveselectgoods',
		   data: $("#form1").serialize(),
		   success: 
		   function(msg){
			 var obj = eval( "(" + msg + ")" );
			 $("#result").html(obj.data);
		    //alert('aakkkkkk');
				$("#result").slideDown("slow");
		   }
		});
		
}

function compress(atype)
{
	
		var aname="";
		switch(atype)
		{
			case 'tb':
				aname="copyimg";
			  break;
			case 'pp':
				aname="copyppimg";
				break;
			case 'ya':
				aname="copyyaimg";
				break;
			default:
				alert('POST GET A ERROR');
		}
		//alert(aname);
		$("#result").hide();
		$.ajax({
				 type: "POST",
				 //这里的URL可以拼接
				 url: '/tbener/admin.php/changedata/'+aname,
				 data: $("#form1").serialize(),
				 success: 
				 function(msg){
				 var obj = eval( "(" + msg + ")" );
				 $("#result").html(obj.data);
					//alert(obj.data);
					$("#result").slideDown("slow");
				 }
			});
		
}

function zip(atype)
{
	
		//alert(atype);
		$("#result").hide();
		$.ajax({
				 type: "POST",
				 //这里的URL可以拼接
				 url: '/tbener/admin.php/Changedata/zip/ctype/'+atype,
				 data: $("#form1").serialize(),
				 success: 
				 function(msg){
				 var obj = eval( "(" + msg + ")" );
				 $("#result").html(obj.data);
					//alert(obj.data);
					$("#result").slideDown("slow");
				 }
			});
			//alert(atype);
}
